# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AppEngine.V1.Model.ProjectEvent do
  @moduledoc """
  The request sent to CLHs during project events.

  ## Attributes

  *   `eventId` (*type:* `String.t`, *default:* `nil`) - The unique ID for this project event. CLHs can use this value to dedup repeated calls. required
  *   `phase` (*type:* `String.t`, *default:* `nil`) - Phase indicates when in the container event propagation this event is being communicated. Events are sent before and after the per-resource events are propagated. required
  *   `projectMetadata` (*type:* `GoogleApi.AppEngine.V1.Model.ProjectsMetadata.t`, *default:* `nil`) - The projects metadata for this project. required
  *   `state` (*type:* `GoogleApi.AppEngine.V1.Model.ContainerState.t`, *default:* `nil`) - The state of the organization that led to this event.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :eventId => String.t() | nil,
          :phase => String.t() | nil,
          :projectMetadata => GoogleApi.AppEngine.V1.Model.ProjectsMetadata.t() | nil,
          :state => GoogleApi.AppEngine.V1.Model.ContainerState.t() | nil
        }

  field(:eventId)
  field(:phase)
  field(:projectMetadata, as: GoogleApi.AppEngine.V1.Model.ProjectsMetadata)
  field(:state, as: GoogleApi.AppEngine.V1.Model.ContainerState)
end

defimpl Poison.Decoder, for: GoogleApi.AppEngine.V1.Model.ProjectEvent do
  def decode(value, options) do
    GoogleApi.AppEngine.V1.Model.ProjectEvent.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AppEngine.V1.Model.ProjectEvent do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
